function LicenseCtrl($scope, $http, $cookieStore) {
	$scope.LICENSE_STATUS = LICENSE_STATUS;
	
	Pagination.initialize("/license/findPage", $scope, $http, 15);
	
	$scope.disableLicense = function (license) {
		Message.confirm("确认", "确认要解绑授权“" + license.id + "”？", function () {
			$http.post("/license/disable/" + license.id).success(function (response) {
				if (response.success) {
					$scope.search();
				} else {
					Message.error("错误", response.message || "解绑失败！");
				}
			});
		});
	};
	
	$scope.enableLicense = function (license) {
		$http.post("/license/enable/" + license.id).success(function (response) {
			if (response.success) {
				$scope.search();
			} else {
				Message.error("错误", response.message || "恢复失败！");
			}
		});
	};
	
	$scope.init = function() {
		$scope.search();
	};
 
	$scope.init();
};

app.controller('LicenseCtrl', LicenseCtrl);